namespace VAdvantage.Model
{

/** Generated Model - DO NOT CHANGE */
using System;
using System.Text;
using VAdvantage.DataBase;
using VAdvantage.Common;
using VAdvantage.Classes;
using VAdvantage.Process;
using VAdvantage.Model;
using VAdvantage.Utility;
using System.Data;
/** Generated Model for M_ProductPrice
 *  @author Jagmohan Bhatt (generated) 
 *  @version Vienna Framework 1.1.1 - $Id$ */
public class X_M_ProductPrice : PO
{
public X_M_ProductPrice (Context ctx, int M_ProductPrice_ID, String trxName) : base (ctx, M_ProductPrice_ID, trxName)
{
/** if (M_ProductPrice_ID == 0)
{
SetM_PriceList_Version_ID (0);
SetM_Product_ID (0);
SetPriceLimit (0.0);
SetPriceList (0.0);
SetPriceStd (0.0);
}
 */
}
public X_M_ProductPrice (Ctx ctx, int M_ProductPrice_ID, String trxName) : base (ctx, M_ProductPrice_ID, trxName)
{
/** if (M_ProductPrice_ID == 0)
{
SetM_PriceList_Version_ID (0);
SetM_Product_ID (0);
SetPriceLimit (0.0);
SetPriceList (0.0);
SetPriceStd (0.0);
}
 */
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_ProductPrice (Context ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_ProductPrice (Ctx ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_ProductPrice (Ctx ctx, IDataReader dr, String trxName) : base(ctx, dr, trxName)
{
}
/** Serial Version No */
static long serialVersionUID = 27542468365432L;
/** Last Updated Timestamp 12/9/2009 12:47:28 PM */
public static long updatedMS = 1260343048643L;
/** AD_Table_ID=251 */
public static int Table_ID=251;

/** TableName=M_ProductPrice */
public static String Table_Name="M_ProductPrice";

protected static KeyNamePair model = new KeyNamePair(251,"M_ProductPrice");

protected Decimal accessLevel = new Decimal(3);
/** AccessLevel
@return 3 - Client - Org 
*/
protected override int Get_AccessLevel()
{
return Convert.ToInt32(accessLevel.ToString());
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Context ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Ctx ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public override String ToString()
{
StringBuilder sb = new StringBuilder ("X_M_ProductPrice[").Append(Get_ID()).Append("]");
return sb.ToString();
}
/** Set Currency.
@param C_Currency_ID The Currency for this record */
public void SetC_Currency_ID (int C_Currency_ID)
{
throw new ArgumentException ("C_Currency_ID Is virtual column");
}
/** Get Currency.
@return The Currency for this record */
public int GetC_Currency_ID() 
{
Object ii = Get_Value("C_Currency_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Price includes Tax.
@param IsTaxIncluded Tax is included in the price  */
public void SetIsTaxIncluded (Boolean IsTaxIncluded)
{
throw new ArgumentException ("IsTaxIncluded Is virtual column");
}
/** Get Price includes Tax.
@return Tax is included in the price  */
public Boolean IsTaxIncluded() 
{
Object oo = Get_Value("IsTaxIncluded");
if (oo != null) 
{
 if (oo.GetType() == typeof(bool)) return Convert.ToBoolean(oo);
 return "Y".Equals(oo);
}
return false;
}
/** Set Price List Version.
@param M_PriceList_Version_ID Identifies a unique instance of a Price List */
public void SetM_PriceList_Version_ID (int M_PriceList_Version_ID)
{
if (M_PriceList_Version_ID < 1) throw new ArgumentException ("M_PriceList_Version_ID is mandatory.");
Set_ValueNoCheck ("M_PriceList_Version_ID", M_PriceList_Version_ID);
}
/** Get Price List Version.
@return Identifies a unique instance of a Price List */
public int GetM_PriceList_Version_ID() 
{
Object ii = Get_Value("M_PriceList_Version_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair */
public KeyNamePair GetKeyNamePair() 
{
return new KeyNamePair(Get_ID(), GetM_PriceList_Version_ID().ToString());
}
/** Set Product.
@param M_Product_ID Product, Service, Item */
public void SetM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1) throw new ArgumentException ("M_Product_ID is mandatory.");
Set_ValueNoCheck ("M_Product_ID", M_Product_ID);
}
/** Get Product.
@return Product, Service, Item */
public int GetM_Product_ID() 
{
Object ii = Get_Value("M_Product_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Limit Price.
@param PriceLimit Lowest price for a product */
public void SetPriceLimit (Decimal? PriceLimit)
{
if (PriceLimit == null) throw new ArgumentException ("PriceLimit is mandatory.");
Set_Value ("PriceLimit", (Decimal?)PriceLimit);
}
/** Get Limit Price.
@return Lowest price for a product */
public Decimal GetPriceLimit() 
{
Object bd =Get_Value("PriceLimit");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
/** Set List Price.
@param PriceList List Price */
public void SetPriceList (Decimal? PriceList)
{
if (PriceList == null) throw new ArgumentException ("PriceList is mandatory.");
Set_Value ("PriceList", (Decimal?)PriceList);
}
/** Get List Price.
@return List Price */
public Decimal GetPriceList() 
{
Object bd =Get_Value("PriceList");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
/** Set Standard Price.
@param PriceStd Standard Price */
public void SetPriceStd (Decimal? PriceStd)
{
if (PriceStd == null) throw new ArgumentException ("PriceStd is mandatory.");
Set_Value ("PriceStd", (Decimal?)PriceStd);
}
/** Get Standard Price.
@return Standard Price */
public Decimal GetPriceStd() 
{
Object bd =Get_Value("PriceStd");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
}

}
